<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/4/8
 * Time: 14:39
 */

namespace app\controllers;

use Yii;

class PepperCashRecordController extends BaseController
{
    /** @var  \common\logics\peppercash\PepperCashLogic  $PepperCashService  ***/
    private $PepperCashService;

    public function init()
    {
        $this->PepperCashService = Yii::$container->get("PepperCashService");
        return parent::init();
    }

    //获取花椒提现列表
    public function actionGetList()
    {
        $param = [
            "buy_id" => Yii::$app->request->post("buy_id",0),       //买手id
            "page_num" => Yii::$app->request->post("page_num",1),   //当前页数
            "limit" => Yii::$app->request->post("limit",10),        //每页条数
            "safetyCode" => Yii::$app->request->post("safetyCode",''),//安全码
        ];
        $result = $this->PepperCashService->getList($param);
        return $result;
    }
    //撤销花椒提现
    public function actionRevoke()
    {
        $param = [
            "buy_id" => Yii::$app->request->post("buy_id",0),                                   //买手id
            "pepper_cash_id" => Yii::$app->request->post("pepper_cash_id",0),                   //申请id
            "safetyCode" => Yii::$app->request->post("safetyCode",''),                          //安全码
        ];
        $result = $this->PepperCashService->revoke($param);
        return $result;
    }
    public function actionApplyCash()
    {
        $param = [
            "buy_id" => Yii::$app->request->post("buy_id",0),                   //买手id
            "pay_pwd" => Yii::$app->request->post("pay_pwd",''),                //提现密码
            "money" => Yii::$app->request->post("money",0),                     //提现金额
        ];
        $result = $this->PepperCashService->applyCash($param);
        return $result;
    }
}